package cn.dnui_cr503.dnuifood_16110100503.fragment;


import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;

import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import cn.dnui_cr503.dnuifood_16110100503.R;
import cn.dnui_cr503.dnuifood_16110100503.controller.SearchActivity;

/**
 * A simple {@link Fragment} subclass.
 */
public class SearchFragment extends BaseFragment {
    Button search_button;
    EditText search;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        super.onCreateView(inflater,container,savedInstanceState);
        View view=inflater.inflate(R.layout.fragment_search, container, false);

        search_button=view.findViewById(R.id.search_button);
        search=view.findViewById(R.id.search);

        initEvents();
        return view;
    }

    void initViews() {
    }


    void initEvents() {
        search_button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent =new Intent(getActivity(),SearchActivity.class);
                intent.putExtra("a",search.getText().toString());
                startActivity(intent);
            }
        });
    }
    
    void initDate() {
    }

}
